const UniPackageOptimization = require('subpackage-optimize');
const isProduction = process.env.NODE_ENV === 'production';

module.exports = {
  configureWebpack: config => {
    // 微信小程序打包优化
    if (process.env.UNI_PLATFORM === 'mp-weixin' && isProduction) {
      config.plugins.push(new UniPackageOptimization(['components'], []));
    }
  }
}
